<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE InterruptibleFFI #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  System.Process.Internals</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2004</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- __Note:__ This module exports internal implementation details that may</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- change anytime.  If you want a more stable API, use &quot;System.Process&quot;</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- instead.</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Process.Internals</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-23"></span><span>    </span><span class="annot"><a href="System.Process.Common.html#ProcessHandle"><span class="hs-identifier">ProcessHandle</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcessHandle__"><span class="hs-identifier">ProcessHandle__</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>    </span><span class="annot"><a href="../../Win32/src/System.Win32.DebugApi.html#PHANDLE"><span class="hs-identifier">PHANDLE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Windows.html#closePHANDLE"><span class="hs-identifier">closePHANDLE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Windows.html#mkProcessHandle"><span class="hs-identifier">mkProcessHandle</span></a></span><span class="hs-special">,</span><span class="hs-cpp">
#ifdef WINDOWS
</span><span>    </span><span class="annot"><a href="System.Process.Common.html#CGid"><span class="hs-identifier">CGid</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-cpp">
#else
</span><span>    </span><span class="hs-identifier">CGid</span><span class="hs-special">,</span><span class="hs-cpp">
#endif
</span><span>    </span><span class="annot"><a href="System.Process.Common.html#GroupID"><span class="hs-identifier">GroupID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="System.Process.Common.html#UserID"><span class="hs-identifier">UserID</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><a href="System.Process.Common.html#modifyProcessHandle"><span class="hs-identifier">modifyProcessHandle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#withProcessHandle"><span class="hs-identifier">withProcessHandle</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>    </span><span class="annot"><a href="System.Process.Common.html#CreateProcess"><span class="hs-identifier">CreateProcess</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><a href="System.Process.Common.html#CmdSpec"><span class="hs-identifier">CmdSpec</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#StdStream"><span class="hs-identifier">StdStream</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcRetHandles"><span class="hs-identifier">ProcRetHandles</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#createProcess_"><span class="hs-identifier">createProcess_</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#runGenProcess_"><span class="hs-identifier">runGenProcess_</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">--deprecated</span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.FD.html#fdToHandle"><span class="hs-identifier">fdToHandle</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><a href="System.Process.Windows.html#startDelegateControlC"><span class="hs-identifier">startDelegateControlC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>    </span><span class="annot"><a href="System.Process.Windows.html#endDelegateControlC"><span class="hs-identifier">endDelegateControlC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><a href="System.Process.Windows.html#stopDelegateControlC"><span class="hs-identifier">stopDelegateControlC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#unwrapHandles"><span class="hs-identifier">unwrapHandles</span></a></span><span class="hs-special">,</span><span class="hs-cpp">
#ifdef WINDOWS
</span><span>    </span><span class="annot"><a href="System.Process.Windows.html#terminateJob"><span class="hs-identifier">terminateJob</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><a href="System.Process.Windows.html#terminateJobUnsafe"><span class="hs-identifier">terminateJobUnsafe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="System.Process.Windows.html#waitForJobCompletion"><span class="hs-identifier">waitForJobCompletion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><a href="System.Process.Windows.html#timeout_Infinite"><span class="hs-identifier">timeout_Infinite</span></a></span><span class="hs-special">,</span><span class="hs-cpp">
#else
</span><span>    </span><span class="hs-identifier">pPrPr_disableITimers</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">c_execvpe</span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-identifier">ignoreSignal</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">defaultSignal</span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-identifier">runInteractiveProcess_lock</span><span class="hs-special">,</span><span class="hs-cpp">
#endif
</span><span>    </span><span class="annot"><a href="System.Process.Common.html#withFilePathException"><span class="hs-identifier">withFilePathException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Windows.html#withCEnvironment"><span class="hs-identifier">withCEnvironment</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#translate"><span class="hs-identifier">translate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#createPipe"><span class="hs-identifier">createPipe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#createPipeFd"><span class="hs-identifier">createPipeFd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>    </span><span class="annot"><a href="System.Process.Internals.html#interruptProcessGroupOf"><span class="hs-identifier">interruptProcessGroupOf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.html#"><span class="hs-identifier">Foreign.C</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.FD.html#"><span class="hs-identifier">GHC.IO.Handle.FD</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Handle.FD.html#fdToHandle"><span class="hs-identifier">fdToHandle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Posix.Internals.html#"><span class="hs-identifier">System.Posix.Internals</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Posix.Internals.html#FD"><span class="hs-identifier">FD</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Process.Common.html"><span class="hs-identifier">System.Process.Common</span></a></span><span class="hs-cpp">

#ifdef WINDOWS
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Process.Windows.html"><span class="hs-identifier">System.Process.Windows</span></a></span><span class="hs-cpp">
#else
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Process.Posix</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- | This function is almost identical to</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- 'System.Process.createProcess'. The only differences are:</span><span>
</span><span id="line-76"></span><span class="hs-comment">--</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- * 'Handle's provided via 'UseHandle' are not closed automatically.</span><span>
</span><span id="line-78"></span><span class="hs-comment">--</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- * This function takes an extra @String@ argument to be used in creating</span><span>
</span><span id="line-80"></span><span class="hs-comment">--   error messages.</span><span>
</span><span id="line-81"></span><span class="hs-comment">--</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- This function has been available from the &quot;System.Process.Internals&quot; module</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- for some time, and is part of the &quot;System.Process&quot; module since version</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- 1.2.1.0.</span><span>
</span><span id="line-85"></span><span class="hs-comment">--</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- @since 1.2.1.0</span><span>
</span><span id="line-87"></span><span class="annot"><a href="System.Process.Internals.html#createProcess_"><span class="hs-identifier hs-type">createProcess_</span></a></span><span>
</span><span id="line-88"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>                     </span><span class="hs-comment">-- ^ function name (for error messages)</span><span>
</span><span id="line-89"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Process.Common.html#CreateProcess"><span class="hs-identifier hs-type">CreateProcess</span></a></span><span>
</span><span id="line-90"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcessHandle"><span class="hs-identifier hs-type">ProcessHandle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span id="createProcess_"><span class="annot"><span class="annottext">createProcess_ :: String
-&gt; CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="System.Process.Internals.html#createProcess_"><span class="hs-identifier hs-var hs-var">createProcess_</span></a></span></span><span> </span><span id="local-6989586621679048244"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048244"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621679048243"><span class="annot"><span class="annottext">CreateProcess
</span><a href="#local-6989586621679048243"><span class="hs-identifier hs-var">proc_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProcRetHandles
-&gt; (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="System.Process.Internals.html#unwrapHandles"><span class="hs-identifier hs-var">unwrapHandles</span></a></span><span> </span><span class="annot"><span class="annottext">(ProcRetHandles
 -&gt; (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
-&gt; IO ProcRetHandles
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; CreateProcess -&gt; IO ProcRetHandles
</span><a href="System.Process.Windows.html#createProcess_Internal"><span class="hs-identifier hs-var">createProcess_Internal</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048244"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="annot"><span class="annottext">CreateProcess
</span><a href="#local-6989586621679048243"><span class="hs-identifier hs-var">proc_</span></a></span><span>
</span><span id="line-92"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="System.Process.Internals.html#createProcess_"><span class="hs-pragma hs-type">createProcess_</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="hs-comment">-- ------------------------------------------------------------------------</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- Escaping commands for shells</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-comment">{-
On Windows we also use this for running commands.  We use CreateProcess,
passing a single command-line string (lpCommandLine) as its argument.
(CreateProcess is well documented on http://msdn.microsoft.com.)

      - It parses the beginning of the string to find the command. If the
        file name has embedded spaces, it must be quoted, using double
        quotes thus
                &quot;foo\this that\cmd&quot; arg1 arg2

      - The invoked command can in turn access the entire lpCommandLine string,
        and the C runtime does indeed do so, parsing it to generate the
        traditional argument vector argv[0], argv[1], etc.  It does this
        using a complex and arcane set of rules which are described here:

           https://msdn.microsoft.com/en-us/library/a1y7w461.aspx

        (if this URL stops working, you might be able to find it by
        searching for &quot;Parsing C Command-Line Arguments&quot; on MSDN.  Also,
        the code in the Microsoft C runtime that does this translation
        is shipped with VC++).

Our goal in runProcess is to take a command filename and list of
arguments, and construct a string which inverts the translatsions
described above, such that the program at the other end sees exactly
the same arguments in its argv[] that we passed to rawSystem.

This inverse translation is implemented by 'translate' below.

Here are some pages that give informations on Windows-related
limitations and deviations from Unix conventions:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
    Command lines and environment variables effectively limited to 8191
    characters on Win XP, 2047 on NT/2000 (probably even less on Win 9x):

    http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/WINDOWSXP/home/using/productdoc/en/percent.asp
    Command-line substitution under Windows XP. IIRC these facilities (or at
    least a large subset of them) are available on Win NT and 2000. Some
    might be available on Win 9x.

    http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/WINDOWSXP/home/using/productdoc/en/Cmd.asp
    How CMD.EXE processes command lines.


Note: CreateProcess does have a separate argument (lpApplicationName)
with which you can specify the command, but we have to slap the
command into lpCommandLine anyway, so that argv[0] is what a C program
expects (namely the application name).  So it seems simpler to just
use lpCommandLine alone, which CreateProcess supports.
-}</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="annot"><a href="System.Process.Internals.html#translate"><span class="hs-identifier hs-type">translate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-150"></span><span id="translate"><span class="annot"><span class="annottext">translate :: String -&gt; String
</span><a href="System.Process.Internals.html#translate"><span class="hs-identifier hs-var hs-var">translate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="System.Process.Windows.html#translateInternal"><span class="hs-identifier hs-var">translateInternal</span></a></span><span>
</span><span id="line-151"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="System.Process.Internals.html#translate"><span class="hs-pragma hs-type">translate</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- unwrapHandles</span><span>
</span><span id="line-155"></span><span class="annot"><a href="System.Process.Internals.html#unwrapHandles"><span class="hs-identifier hs-type">unwrapHandles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcRetHandles"><span class="hs-identifier hs-type">ProcRetHandles</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcessHandle"><span class="hs-identifier hs-type">ProcessHandle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span id="unwrapHandles"><span class="annot"><span class="annottext">unwrapHandles :: ProcRetHandles
-&gt; (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="System.Process.Internals.html#unwrapHandles"><span class="hs-identifier hs-var hs-var">unwrapHandles</span></a></span></span><span> </span><span id="local-6989586621679048240"><span class="annot"><span class="annottext">ProcRetHandles
</span><a href="#local-6989586621679048240"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProcRetHandles -&gt; Maybe Handle
</span><a href="System.Process.Common.html#hStdInput"><span class="hs-identifier hs-var hs-var">hStdInput</span></a></span><span> </span><span class="annot"><span class="annottext">ProcRetHandles
</span><a href="#local-6989586621679048240"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProcRetHandles -&gt; Maybe Handle
</span><a href="System.Process.Common.html#hStdOutput"><span class="hs-identifier hs-var hs-var">hStdOutput</span></a></span><span> </span><span class="annot"><span class="annottext">ProcRetHandles
</span><a href="#local-6989586621679048240"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProcRetHandles -&gt; Maybe Handle
</span><a href="System.Process.Common.html#hStdError"><span class="hs-identifier hs-var hs-var">hStdError</span></a></span><span> </span><span class="annot"><span class="annottext">ProcRetHandles
</span><a href="#local-6989586621679048240"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProcRetHandles -&gt; ProcessHandle
</span><a href="System.Process.Common.html#procHandle"><span class="hs-identifier hs-var hs-var">procHandle</span></a></span><span> </span><span class="annot"><span class="annottext">ProcRetHandles
</span><a href="#local-6989586621679048240"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-159"></span><span class="hs-comment">-- Deprecated / compat</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">runGenProcess_</span><span>
</span><span id="line-162"></span><span>      </span><span class="hs-pragma">&quot;Please do not use this anymore, use the ordinary 'System.Process.createProcess'. If you need the SIGINT handling, use delegate_ctlc = True (runGenProcess_ is now just an imperfectly emulated stub that probably duplicates or overrides your own signal handling).&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-163"></span><span class="annot"><a href="System.Process.Internals.html#runGenProcess_"><span class="hs-identifier hs-type">runGenProcess_</span></a></span><span>
</span><span id="line-164"></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>                     </span><span class="hs-comment">-- ^ function name (for error messages)</span><span>
</span><span id="line-165"></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Process.Common.html#CreateProcess"><span class="hs-identifier hs-type">CreateProcess</span></a></span><span>
</span><span id="line-166"></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CLong"><span class="hs-identifier hs-type">CLong</span></a></span><span>                </span><span class="hs-comment">-- ^ handler for SIGINT</span><span>
</span><span id="line-167"></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CLong"><span class="hs-identifier hs-type">CLong</span></a></span><span>                </span><span class="hs-comment">-- ^ handler for SIGQUIT</span><span>
</span><span id="line-168"></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcessHandle"><span class="hs-identifier hs-type">ProcessHandle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- On Windows, setting delegate_ctlc has no impact</span><span>
</span><span id="line-170"></span><span id="runGenProcess_"><span class="annot"><span class="annottext">runGenProcess_ :: String
-&gt; CreateProcess
-&gt; Maybe CLong
-&gt; Maybe CLong
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="System.Process.Internals.html#runGenProcess_"><span class="hs-identifier hs-var hs-var">runGenProcess_</span></a></span></span><span> </span><span id="local-6989586621679048235"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048235"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621679048234"><span class="annot"><span class="annottext">CreateProcess
</span><a href="#local-6989586621679048234"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679048233"><span class="annot"><span class="annottext">CLong
</span><a href="#local-6989586621679048233"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679048232"><span class="annot"><span class="annottext">CLong
</span><a href="#local-6989586621679048232"><span class="hs-identifier hs-var">sig'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CLong -&gt; Bool
</span><a href="System.Process.Windows.html#isDefaultSignal"><span class="hs-identifier hs-var">isDefaultSignal</span></a></span><span> </span><span class="annot"><span class="annottext">CLong
</span><a href="#local-6989586621679048233"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">CLong
</span><a href="#local-6989586621679048233"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="annot"><span class="annottext">CLong -&gt; CLong -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">CLong
</span><a href="#local-6989586621679048232"><span class="hs-identifier hs-var">sig'</span></a></span><span>
</span><span id="line-171"></span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="System.Process.Internals.html#createProcess_"><span class="hs-identifier hs-var">createProcess_</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048235"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">CreateProcess
</span><a href="#local-6989586621679048234"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">delegate_ctlc :: Bool
</span><a href="System.Process.Common.html#delegate_ctlc"><span class="hs-identifier hs-var">delegate_ctlc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-172"></span><span class="annot"><a href="System.Process.Internals.html#runGenProcess_"><span class="hs-identifier hs-var">runGenProcess_</span></a></span><span> </span><span id="local-6989586621679048228"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048228"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621679048227"><span class="annot"><span class="annottext">CreateProcess
</span><a href="#local-6989586621679048227"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe CLong
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe CLong
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="System.Process.Internals.html#createProcess_"><span class="hs-identifier hs-var">createProcess_</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048228"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">CreateProcess
</span><a href="#local-6989586621679048227"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- createPipe</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | Create a pipe for interprocess communication and return a</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- @(readEnd, writeEnd)@ `Handle` pair.</span><span>
</span><span id="line-179"></span><span class="hs-comment">--</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- @since 1.2.1.0</span><span>
</span><span id="line-181"></span><span class="annot"><a href="System.Process.Internals.html#createPipe"><span class="hs-identifier hs-type">createPipe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span id="createPipe"><span class="annot"><span class="annottext">createPipe :: IO (Handle, Handle)
</span><a href="System.Process.Internals.html#createPipe"><span class="hs-identifier hs-var hs-var">createPipe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (Handle, Handle)
</span><a href="System.Process.Windows.html#createPipeInternal"><span class="hs-identifier hs-var">createPipeInternal</span></a></span><span>
</span><span id="line-183"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="System.Process.Internals.html#createPipe"><span class="hs-pragma hs-type">createPipe</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- createPipeFd</span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="hs-comment">-- | Create a pipe for interprocess communication and return a</span><span>
</span><span id="line-189"></span><span class="hs-comment">-- @(readEnd, writeEnd)@ `FD` pair.</span><span>
</span><span id="line-190"></span><span class="hs-comment">--</span><span>
</span><span id="line-191"></span><span class="hs-comment">-- @since 1.4.2.0</span><span>
</span><span id="line-192"></span><span class="annot"><a href="System.Process.Internals.html#createPipeFd"><span class="hs-identifier hs-type">createPipeFd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/System.Posix.Internals.html#FD"><span class="hs-identifier hs-type">FD</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/System.Posix.Internals.html#FD"><span class="hs-identifier hs-type">FD</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span id="createPipeFd"><span class="annot"><span class="annottext">createPipeFd :: IO (FD, FD)
</span><a href="System.Process.Internals.html#createPipeFd"><span class="hs-identifier hs-var hs-var">createPipeFd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (FD, FD)
</span><a href="System.Process.Windows.html#createPipeInternalFd"><span class="hs-identifier hs-var">createPipeInternalFd</span></a></span><span>
</span><span id="line-194"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="System.Process.Internals.html#createPipeFd"><span class="hs-pragma hs-type">createPipeFd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- interruptProcessGroupOf</span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-comment">-- | Sends an interrupt signal to the process group of the given process.</span><span>
</span><span id="line-201"></span><span class="hs-comment">--</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- On Unix systems, it sends the group the SIGINT signal.</span><span>
</span><span id="line-203"></span><span class="hs-comment">--</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- On Windows systems, it generates a CTRL_BREAK_EVENT and will only work for</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- processes created using 'createProcess' and setting the 'create_group' flag</span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span class="annot"><a href="System.Process.Internals.html#interruptProcessGroupOf"><span class="hs-identifier hs-type">interruptProcessGroupOf</span></a></span><span>
</span><span id="line-208"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Process.Common.html#ProcessHandle"><span class="hs-identifier hs-type">ProcessHandle</span></a></span><span>    </span><span class="hs-comment">-- ^ A process in the process group</span><span>
</span><span id="line-209"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span id="interruptProcessGroupOf"><span class="annot"><span class="annottext">interruptProcessGroupOf :: ProcessHandle -&gt; IO ()
</span><a href="System.Process.Internals.html#interruptProcessGroupOf"><span class="hs-identifier hs-var hs-var">interruptProcessGroupOf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProcessHandle -&gt; IO ()
</span><a href="System.Process.Windows.html#interruptProcessGroupOfInternal"><span class="hs-identifier hs-var">interruptProcessGroupOfInternal</span></a></span><span>
</span><span id="line-211"></span></pre></body></html>